<!DOCTYPE html>
<html>
<base href="__STATIC__/admin/">
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit">



    <link href="css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=2.2.0" rel="stylesheet">

</head>

<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">

                        <div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="img/profile_small.jpg" />
                             </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
                                <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">Beaut-zihan</strong>
                             </span>  <span class="text-muted text-xs block">超级管理员 <b class="caret"></b></span> </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a href="form_avatar.html">修改头像</a>
                                </li>
                                <li><a href="profile.html">个人资料</a>
                                </li>
                                <li><a href="contacts.html">联系我们</a>
                                </li>
                                <li><a href="mailbox.html">信箱</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href="login.html">安全退出</a>
                                </li>
                            </ul>
                        </div>
                        <div class="logo-element">
                            H+
                        </div>

                    </li>
                    <li>
                        <a href="index.html"><i class="fa fa-th-large"></i> <span class="nav-label">用户管理</span> <span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="index_1.html">用户列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="layouts.html"><i class="fa fa-columns"></i> <span class="nav-label">商品管理</span><span class="label label-danger pull-right"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="{:url('admin/index/table_data_tables')}">商品列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="index.html#"><i class="fa fa fa-globe"></i> <span class="nav-label">管理员管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="toastr_notifications.html">管理员列表</a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href="index.html#"><i class="fa fa-bar-chart-o"></i> <span class="nav-label">轮播图管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="graph_echarts.html">轮播图列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="mailbox.html"><i class="fa fa-envelope"></i> <span class="nav-label">广告位管理</span><span class="label label-warning pull-right"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="mailbox.html">广告位列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="widgets.html"><i class="fa fa-flask"></i> <span class="nav-label">品牌管理</span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="{:url('admin/index/table_data_tables')}">品牌列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="index.html#"><i class="fa fa-edit"></i> <span class="nav-label">商品分类管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="form_basic.html">商品分类列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="index.html#"><i class="fa fa-desktop"></i> <span class="nav-label">评价管理</span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="contacts.html">评价列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="index.html#"><i class="fa fa-files-o"></i> <span class="nav-label">投诉管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="{:url('admin/feedback/feedback_list_one')}">审核投诉列表</a>
                            </li>
                            <li><a href="{:url('admin/feedback/feedback_list_two')}">显示投诉列表</a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href="index.html#"><i class="fa fa-flask"></i> <span class="nav-label">商家管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="typography.html">商家列表</a>
                            </li>
                        </ul>
                    </li>

                    <!--<li class="active">-->
                        <!--<a href="index.html#"><i class="fa fa-table"></i> <span class="nav-label">表格</span><span class="fa arrow"></span></a>-->
                        <!--<ul class="nav nav-second-level">-->
                            <!--<li><a href="table_basic.html">基本表格</a>-->
                            <!--</li>-->
                            <!--<li class="active"><a href="table_data_tables.html">数据表格(DataTables)</a>-->
                            <!--</li>-->
                            <!--<li><a href="table_jqgrid.html">jqGrid</a>-->
                            <!--</li>-->
                        <!--</ul>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<a href="index.html#"><i class="fa fa-picture-o"></i> <span class="nav-label">图库</span><span class="fa arrow"></span></a>-->
                        <!--<ul class="nav nav-second-level">-->
                            <!--<li><a href="basic_gallery.html">基本图库</a>-->
                            <!--</li>-->
                            <!--<li><a href="carousel.html">图片切换</a>-->
                            <!--</li>-->

                        <!--</ul>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<a href="index.html#"><i class="fa fa-sitemap"></i> <span class="nav-label">菜单 </span><span class="fa arrow"></span></a>-->
                        <!--<ul class="nav nav-second-level">-->
                            <!--<li>-->
                                <!--<a href="index.html#">三级菜单 <span class="fa arrow"></span></a>-->
                                <!--<ul class="nav nav-third-level">-->
                                    <!--<li>-->
                                        <!--<a href="index.html#">三级菜单 01</a>-->
                                    <!--</li>-->
                                    <!--<li>-->
                                        <!--<a href="index.html#">三级菜单 01</a>-->
                                    <!--</li>-->
                                    <!--<li>-->
                                        <!--<a href="index.html#">三级菜单 01</a>-->
                                    <!--</li>-->

                                <!--</ul>-->
                            <!--</li>-->
                            <!--<li><a href="index.html#">二级菜单</a>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<a href="index.html#">二级菜单</a>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<a href="index.html#">二级菜单</a>-->
                            <!--</li>-->
                        <!--</ul>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<a href="webim.html"><i class="fa fa-comments"></i> <span class="nav-label">即时通讯</span><span class="label label-danger pull-right">New</span></a>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<a href="css_animation.html"><i class="fa fa-magic"></i> <span class="nav-label">CSS动画</span></a>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<a href="index.html#"><i class="fa fa-cutlery"></i> <span class="nav-label">工具 </span><span class="fa arrow"></span></a>-->
                        <!--<ul class="nav nav-second-level">-->
                            <!--<li><a href="form_builder.html">表单构建器</a>-->
                            <!--</li>-->
                        <!--</ul>-->
                    <!--</li>-->
                </ul>

            </div>
        </nav>

        <div id="page-wrapper" class="gray-bg dashbard-1">
                        <div class="row border-bottom">
                            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">



                </nav>
            </div>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>订单列表</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="index.html">主页</a>
                        </li>
                        <li>
                            <a>订单管理</a>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
            <div class="wrapper wrapper-content animated fadeInRight">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">

                                <div class="ibox-tools">
                                    <a class="collapse-link">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                    <a class="dropdown-toggle" data-toggle="dropdown" href="table_data_tables.html#">
                                        <i class="fa fa-wrench"></i>
                                    </a>
                                    <ul class="dropdown-menu dropdown-user">
                                        <li><a href="table_data_tables.html#">选项1</a>
                                        </li>
                                        <li><a href="table_data_tables.html#">选项2</a>
                                        </li>
                                    </ul>
                                    <a class="close-link">
                                        <i class="fa fa-times"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="ibox-content">

                                <table class="table table-striped table-bordered table-hover dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>订单ID</th>
                                            <th>订单编号</th>
                                            <th>店铺ID</th>
                                            <th>用户ID</th>
                                            <th>商品ID</th>
                                            <th>订单总价</th>
                                            <th>支付价格</th>
                                            <th>订单生成时间</th>
                                            <th>支付状态</th>
                                            <th>支付方式</th>
                                            <th>收货人</th>
                                            <th>联系方式</th>
                                            <th>详细收货地址</th>
                                            <th>邮编</th>
                                            <th>买家留言</th>
                                            <th>商品数量</th>
                                            <th>支付单号</th>
                                            <th>退款状态</th>
                                            <th>退款原因</th>
                                            <th>退款时间</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php foreach($data as $key => $val) { ?>
                                        <tr class="gradeX" >
                                            <td><?= $val['o_id'] ?></td>
                                            <td><?= $val['o_sn'] ?></td>
                                            <td><?= $val['m_id'] ?></td>
                                            <td><?= $val['u_id'] ?></td>
                                            <td><?= $val['g_id'] ?></td>
                                            <td><?= $val['o_price'] ?></td>
                                            <td><?= $val['o_price_zs'] ?></td>
                                            <td><?= date('Y-m-d H:i:s',$val['o_addtime']) ?></td>
                                            <td>
                                                <span id="zf">
                                                    {if condition=" $val.o_statc eq 0"}
                                                    <span >待支付</span>
                                                    {elseif condition="$val.o_statc eq 1"}
                                                    <span>已支付</span>
                                                    {else/}
                                                    <span>支付失败</span>
                                                    {/if}
                                                </span>
                                                <select name="statc" where="<?= $val['o_id'] ?>" id="o_statc" style="display: none">
                                                    <option value="0">待支付</option>
                                                    <option value="10">已支付</option>
                                                    <option value="20">支付失败</option>
                                                </select>


                                            </td>
                                            <td><?= $val['o_type'] ?></td>
                                            <td><?= $val['o_receiver'] ?></td>
                                            <td><?= $val['o_tel'] ?></td>
                                            <td><?= $val['o_address'] ?></td>
                                            <td><?= $val['o_code'] ?></td>
                                            <td><?= $val['o_remark'] ?></td>
                                            <td><?= $val['o_num'] ?></td>
                                            <td><?= $val['o_pay_sn'] ?></td>
                                            <td>
                                                <span id="tk">
                                                    {if condition=" $val.o_back eq 0"}
                                                    <span  >待退款</span>
                                                    {elseif condition="$val.o_back eq 1"}
                                                    <span  >已退款</span>
                                                    {else/}
                                                    <span >未退款</span>
                                                    {/if}
                                                </span>
                                                <select name="back" where="<?= $val['o_id'] ?>" id="o_back" style="display: none">
                                                    <option value="0">待退款</option>
                                                    <option value="10">已退款</option>
                                                    <option value="20">未退款</option>
                                                </select>

                                            </td>
                                            <td><?= $val['o_back_remark'] ?></td>
                                            <td><?= date('Y-m-d H:i:s',$val['o_back_addtime']) ?></td>
                                            <td><a href="{:url('shangjia/indert/indert_xq')}?o_id=<?= $val['o_id'] ?>">订单详情</a></td>

                                        </tr>
                                    <?php } ?>
                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="footer">
                <div class="pull-right">
                    By：<a href="http://www.zi-han.net" target="_blank">zihan's blog</a>
                </div>
                <div>
                    <strong>Copyright</strong> H+ &copy; 2014
                </div>
            </div>

        </div>
    </div>


    </div>

    <!-- Mainly scripts -->
    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="js/bootstrap.min.js?v=3.4.0"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

    <script src="js/plugins/jeditable/jquery.jeditable.js"></script>

    <!-- Data Tables -->
    <script src="js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="js/hplus.js?v=2.2.0"></script>
    <script src="js/plugins/pace/pace.min.js"></script>

    <!-- Page-Level Scripts -->ta
    <script>
        $(document).on("click",'#wsh',function () {
            var f_id = $(this).parents('tr').attr('where');
            var txt = $(this).text();
            var obj = $(this);
            if(txt == '未审核')
            {
                var p = '审核通过';
            }
            else
            {
                p = '未审核';
            }
            $.get("{:url('feedback/feedback_sh')}",{p:p,f_id:f_id},
                function (data)
                {
                    if(data==1)
                    {
                        obj.parents('tr').remove();
                    }
                }
            );
        })

        // $(document).on("click",'#notui',function () {
        //     var b_id = $(this).parents('tr').attr('where');
        //     var txt = $(this).text();
        //     var obj = $(this);
        //     if(txt == '未推荐')
        //     {
        //         var p = '推荐中';
        //     }
        //     else
        //     {
        //         p = '未推荐';
        //     }
        //     $.get("{:url('brand/notui')}",{p:p,b_id:b_id},
        //         function (data)
        //         {
        //             if(data==1)
        //             {
        //                 obj.replaceWith('<button id="tui">'+p+'</button>');
        //             }
        //         }
        //     );
        // })

        $(document).on('click','#del',function(){
            var b_id=$(this).parents('tr').attr('where');
            var obj = $(this);
            $.get("{:url('brand/del')}", {b_id:b_id },
                function(data){

                    if (data == 1)
                    {
                        alert("删除成功");
                        obj.parents('tr').remove();
                    }
                });
        });

        $(document).on("click","#span",function () {
            var span = $(this);
            var input = $(this).next();
            span.hide();
            input.show();

            var span_text = span.text();
            input.focus();
            input.val(span_text);
        })

        $(document).on("blur","#input",function () {
            var b_id = $(this).attr('that');
            var input = $(this);
            var span = $(this).prev();
            var b_content = input.val();
            $.get("{:url('brand/brand_upd')}", {b_id:b_id ,b_content:b_content},
                function(data){

                    if (data == 1)
                    {
                        alert('修改成功！');
                        input.hide();
                        span.show();
                        span.text(b_content);
                    }
                    else
                    {
                        alert('修改失败');
                        input.hide();
                        span.show();
                        span.text(b_content);
                    }
                });

        })

        //隐藏当前状态 显示下拉框
        $(document).on('click','td #zf',function(){
            $(this).hide();
            $(this).next().show();

        })
        //修改下拉框值
        $(document).on('blur','#o_statc',function(){
             var zt = $("#o_statc option:selected").html();
             var o_id = $(this).attr('where');
             var o_statc = $("#o_statc option:selected").val();
             var _this = $(this);


            $.ajax({
                type:'post',
                url:"{:url('shangjia/indert/indert_upd')}",
                data:{
                    o_id:o_id,
                    o_statc:o_statc
                },
                success:function(res){
                    if(res == 1){
                        _this.hide();
                        _this.prev().show().html(zt);
                    }
                    if(res == 0){
                        alert('修改失败！');
                    }
                }
            })
        })




        //隐藏退款 显示下拉框
        $(document).on('click','td #tk',function(){
            $(this).hide();
            $(this).next().show();

        })
        //修改下拉框值
        $(document).on('blur','#o_back',function(){
            var tk = $("#o_back option:selected").html();
            var o_id = $(this).attr('where');
            var o_back = $("#o_back option:selected").val();
            var _this = $(this);


            $.ajax({
                type:'post',
                url:"{:url('shangjia/indert/indert_tk')}",
                data:{
                    o_id:o_id,
                    o_back:o_back
                },
                success:function(res){
                    if(res == 1){
                        _this.hide();
                        _this.prev().show().html(tk);
                    }
                    if(res == 0){
                        alert('修改失败！');
                    }
                }
            })
        })


        $(document).ready(function () {
            $('.dataTables-example').dataTable();

            /* Init DataTables */
            var oTable = $('#editable').dataTable();

            /* Apply the jEditable handlers to the table */
            oTable.$('td').editable('../example_ajax.php', {
                "callback": function (sValue, y) {
                    var aPos = oTable.fnGetPosition(this);
                    oTable.fnUpdate(sValue, aPos[0], aPos[1]);
                },
                "submitdata": function (value, settings) {
                    return {
                        "row_id": this.parentNode.getAttribute('id'),
                        "column": oTable.fnGetPosition(this)[2]
                    };
                },

                "width": "90%",
                "height": "100%"
            });


        });

        function fnClickAddRow() {
            $('#editable').dataTable().fnAddData([
                "Custom row",
                "New row",
                "New row",
                "New row",
                "New row"]);

        }
    </script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script><!--统计代码，可删除-->

</body>

</html>
